﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="gridDetailReport.ascx.cs" Inherits="GUESTSMANAGEMENT.View.Report.gridDetailReport" %>
<%@ Register assembly="Coolite.Ext.Web" namespace="Coolite.Ext.Web" tagprefix="ext" %>

<ext:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
</ext:ScriptManagerProxy>

<script type="text/javascript">

    var formatConfirm5 = function(value) {
        if (value != null || values !="") {
            return "Confirmado";
        }
        else {
            return "Não Confirmado"
        }
    }

    var formatTypeInvite = function(value) {
        switch (value) {
            case 1: return "Bônus Feminino"; break;
            case 2: return "Bônus Masculino"; break;
            case 3: return "Free Feminino"; break;
            case 4: return "Free Masculino"; break;
        }
    }
    
</script>

<ext:DesktopWindow ID="winGrdDetailReport" AutoHeight="true" Resizable="false" Maximizable="false" ExpandOnShow="false" runat="server" Collapsible="true" Icon="User" Title="Relatório" Width="820" Height="400">
    <Body>
        <ext:Store ID="reportDetailStore" runat="server" RefreshAfterSaving="Auto">
            <Reader>
                <ext:JsonReader>
                    <Fields>
                        <ext:RecordField Name="NMUSER" />
                        <ext:RecordField Name="NMGUEST" />                        
                        <ext:RecordField Name="TMCONFIRM" />
                        <ext:RecordField Name="FGTYPEINVITE" />
                        <ext:RecordField Name="NMEVENT" />
                        <ext:RecordField Name="DTEVENT" Type="Date" />
                    </Fields>
                </ext:JsonReader>
            </Reader>
        </ext:Store> 
               
       <ext:Panel ID="Panel1" runat="server" Width="815" Height="470">
            <Body>
                <ext:BorderLayout ID="BorderLayout1" runat="server">
                    <North>
                        <ext:FormPanel Width="200" Height="60" ID="FormPanel2" runat="server" Title="Dados do Evento" BodyStyle="padding:5px;" ButtonAlign="Right">
                            <Body>
                                <ext:ColumnLayout ID="ColumnLayout1" runat="server">
                                    <ext:LayoutColumn ColumnWidth=".4">
                                        <ext:Panel ID="LayoutColumn1" runat="server" Border="false">
                                            <Body>
                                                <ext:FormLayout ID="FormLayout2" runat="server">
                                                    <ext:Anchor>
                                                        <ext:DateField ID="eventDate" FieldLabel="Data" runat="server" AllowBlank="true" Width="100" BlankText="Data é requerido!" >
                                                            <AjaxEvents>
                                                                <Select OnEvent="EnventDateSelected" />
                                                            </AjaxEvents>
                                                        </ext:DateField>
                                                    </ext:Anchor>    
                                                </ext:FormLayout>
                                            </Body>
                                        </ext:Panel>
                                    </ext:LayoutColumn>
                                    <ext:LayoutColumn ColumnWidth=".6">
                                        <ext:Panel ID="LayoutColumn2" runat="server" Border="false">
                                            <Body>
                                                <ext:FormLayout ID="FormLayout3" runat="server">
                                                    <ext:Anchor>
                                                        <ext:TextField Width="200" ID="eventName" ReadOnly="true" FieldLabel="Evento" runat="server" MaxLength="255" />
                                                    </ext:Anchor>
                                                </ext:FormLayout>
                                            </Body>
                                        </ext:Panel>
                                    </ext:LayoutColumn>
                                </ext:ColumnLayout>
                            </Body>
                        </ext:FormPanel>
                    </North>
                    <Center>
                        <ext:GridPanel ID="reportGridPanel" 
                            runat="server"
                            StoreID="reportDetailStore"
                            StripeRows="true"
                            Width="750"
                            Height="470"
                            Disabled="true"
                            >                            
                            <ColumnModel ID="ColumnModel1" runat="server">
                                <Columns>
                                    <ext:Column ColumnID="userName" Header="Promoter" Width="200" DataIndex="NMUSER" Sortable="true" />
                                    <ext:Column ColumnID="guetName" Header="Convidado" Width="200" DataIndex="NMGUEST" Sortable="true" />
                                    <ext:Column ColumnID="confirmeCd" Header="Confirmação" Width="100" DataIndex="TMCONFIRM" Sortable="true" ><Renderer Fn="formatConfirm5" /></ext:Column>
                                    <ext:Column ColumnID="tipeInvite" Header="Tipo Convite" Width="100" DataIndex="FGTYPEINVITE" Sortable="true"> <Renderer Fn="formatTypeInvite" /> </ext:Column>
                                    <ext:Column ColumnID="eventName" Header="Evento" Width="75" DataIndex="NMEVENT" Sortable="true" />
                                    <ext:Column ColumnID="dateEvent" Header="Data Evento" Width="125" DataIndex="DTEVENT" Sortable="true" />
                                </Columns>
                            </ColumnModel>
                            
                            <LoadMask ShowMask="true" />
                            <SaveMask ShowMask="true" />
                            <BottomBar>
                                <ext:PagingToolBar ID="PagingToolBar" runat="server" PageSize="50" StoreID="reportDetailStore" />
                            </BottomBar>
                        </ext:GridPanel>
                    </Center>
                </ext:BorderLayout>
            </Body>
        </ext:Panel>
    </Body>
</ext:DesktopWindow>